package com.lanou.lenanapp.beans;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by dllo on 15/10/29.
 */
public class SpecialGut {


    /**
     * likes : 199.68
     * update_time : 1445817600
     * source : 1
     * wbody : 抱怨是一件最没意义的事情。如果实在难以忍受周围的环境，那就暗自努力练好本领，然后跳出那个圈子。
     * w_sensitive : 1
     * wpic_s_width : 80
     * wpic_s_height : 120
     * wpic_m_width : 440
     * wpic_m_height : 660
     * is_gif : 0
     * wpic_small : B+Lrwe4l35Cti2NOEMXW1SIx05+i3qpRuk3a3dtw2MtIf+cW+InqW40MOfu3P5mL/3aGfWCW3aKt
     fKJVtC5+TUeUKXm+YrYNYW7YM/RkIlQ=
     * wpic_middle : B+Lrwe4l35Cti2NOEMXW1SWezFahSsc9LoJUfr5QYNLvvdIrNX55Du9yRtG3lfHIpxWpV8uHPo9I
     I+if1Pe1QjeiufRT0H6+BxORPT4HpkY=
     * wpic_large : B+Lrwe4l35Cti2NOEMXW1VqJLz1pQiBtocnZkocACscmeHkg7sp6g+L2Oe6qE8X5vokOlC6S6ZCb
     fU5mT2BuXFatpZzGnFVfKkZgcDSLsAs=
     * cmt_disabled : 1
     * wid : 71148
     * comments : 0
     */

    private String likes;
    private String update_time;
    private String source;
    private String wbody;
    private String w_sensitive;
    private String wpic_s_width;
    private String wpic_s_height;
    private String wpic_m_width;
    private String wpic_m_height;
    private String is_gif;
    private String wpic_small;
    private String wpic_middle;
    private String wpic_large;
    private String cmt_disabled;
    private String wid;
    private String comments;

    public static SpecialGut objectFromData(String str) {

        return new Gson().fromJson(str, SpecialGut.class);
    }

    public static SpecialGut objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), SpecialGut.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<SpecialGut> arraySpecialGutFromData(String str) {

        Type listType = new TypeToken<ArrayList<SpecialGut>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<SpecialGut> arraySpecialGutFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<SpecialGut>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public void setLikes(String likes) {
        this.likes = likes;
    }

    public void setUpdate_time(String update_time) {
        this.update_time = update_time;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public void setWbody(String wbody) {
        this.wbody = wbody;
    }

    public void setW_sensitive(String w_sensitive) {
        this.w_sensitive = w_sensitive;
    }

    public void setWpic_s_width(String wpic_s_width) {
        this.wpic_s_width = wpic_s_width;
    }

    public void setWpic_s_height(String wpic_s_height) {
        this.wpic_s_height = wpic_s_height;
    }

    public void setWpic_m_width(String wpic_m_width) {
        this.wpic_m_width = wpic_m_width;
    }

    public void setWpic_m_height(String wpic_m_height) {
        this.wpic_m_height = wpic_m_height;
    }

    public void setIs_gif(String is_gif) {
        this.is_gif = is_gif;
    }

    public void setWpic_small(String wpic_small) {
        this.wpic_small = wpic_small;
    }

    public void setWpic_middle(String wpic_middle) {
        this.wpic_middle = wpic_middle;
    }

    public void setWpic_large(String wpic_large) {
        this.wpic_large = wpic_large;
    }

    public void setCmt_disabled(String cmt_disabled) {
        this.cmt_disabled = cmt_disabled;
    }

    public void setWid(String wid) {
        this.wid = wid;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

    public String getLikes() {
        return likes;
    }

    public String getUpdate_time() {
        return update_time;
    }

    public String getSource() {
        return source;
    }

    public String getWbody() {
        return wbody;
    }

    public String getW_sensitive() {
        return w_sensitive;
    }

    public String getWpic_s_width() {
        return wpic_s_width;
    }

    public String getWpic_s_height() {
        return wpic_s_height;
    }

    public String getWpic_m_width() {
        return wpic_m_width;
    }

    public String getWpic_m_height() {
        return wpic_m_height;
    }

    public String getIs_gif() {
        return is_gif;
    }

    public String getWpic_small() {
        return wpic_small;
    }

    public String getWpic_middle() {
        return wpic_middle;
    }

    public String getWpic_large() {
        return wpic_large;
    }

    public String getCmt_disabled() {
        return cmt_disabled;
    }

    public String getWid() {
        return wid;
    }

    public String getComments() {
        return comments;
    }
}
